package com.lwc.backendsinglestructure.strategy.registerStrategy;

import com.lwc.backendsinglestructure.strategy.RegisterStrategy;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 注册策略工厂
 */
@Component
public class RegisterStrategyFactory {

    @Autowired
    private Map<String,RegisterStrategy> registerStrategyMap;

    /**
     * 获取出具体的bean
     * @param registerType
     * @return
     */
    public RegisterStrategy getRegisterStrategy(String registerType){
        return registerStrategyMap.get(registerType + "_REGISTER");
    }

}
